# coding = utf-8



# global引用全局变量
b = 32
def quanju():
    global b
    b = 26
    print(b)

print(b)
quanju()
print(b)




# nonlocal引用外层函数的局部变量，一般是装饰器，闭包使用
def quanju():
    a = 26
    def neiceng():
        nonlocal a
        a = 13
        print(a)
    print(a)
    return neiceng

neiceng = quanju()
print(neiceng())